package cn.shyouchi.wuguanjia.android.ui.meetting.launch;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.ui.meetting.common.MeetPerson;

/**
 * Created by Eenie on 2017/2/13 at 16:30
 * Email: 472279981@qq.com
 * Des:
 */

public class LaunchMeetPersonAdapter extends BaseQuickAdapter<MeetPerson, BaseViewHolder> {

    public LaunchMeetPersonAdapter( List<MeetPerson> data) {
        super(R.layout.item_meet_person_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, final MeetPerson person) {
        holder.setText(R.id.tv_person_name, person.getName());

        holder.getView(R.id.img_del).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getData().remove(person);
                notifyDataSetChanged();
            }
        });

    }
}
